<template>
  <el-table-column v-if="cProps.column.show" v-bind="cProps.column">
    <template v-if="cProps.column.children && cProps.column.children.length">
      <common-column v-for="child in cProps.column.children" v-bind="{ column:child }"/>
    </template>
  </el-table-column>
</template>

<script setup>
import { defineProps, computed } from "vue"
import {ElTableColumn} from "element-plus";
const props = defineProps({
  column: Object,
})
const cProps = computed(() => {
  if (props.column && Object.keys(props.column)) {
    const show = props.column.hasOwnProperty('show') ? props.column.show : true
    const align = props.column.hasOwnProperty('align') ? props.column.align : 'center'
    return { column: { ...props.column, align, show } }
  } else {
    return { column: {show: false} }
  }
})
</script>

<style scoped lang="scss">

</style>
